const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: () => import('@/views/home.vue'),
    meta: {
      title: '首页',
      isShowNavBar: false,
      isShowTabBar: true,
    },
  },
  {
    path: '/shopcar',
    name: 'shopcar',
    component: () => import('@/views/shopcar.vue'),
    meta: {
      title: '购物车',
      isShowNavBar: true,
      isShowTabBar: true,
      isShowBackIcon: false,
      requireAuth: true,
    },
  },
  {
    path: '/user',
    component: () => import('@/views/user.vue'),
    meta: {
      title: '个人',
      isShowNavBar: false,
      isShowTabBar: true,
    },
  },
  {
    path: '/order',
    component: () => import('@/views/order.vue'),
    meta: {
      title: '订单',
      isShowNavBar: true,
      isShowTabBar: false,
      isShowBackIcon: true,
      requireAuth: true,
    },
  },
  {
    path: '/orderdetail/:order_id',
    component: () => import('@/views/orderdetail.vue'),
    meta: {
      title: '订单详情',
      isShowNavBar: true,
      isShowTabBar: false,
      isShowBackIcon: true,
      requireAuth: true,
    },
  },
  {
    path: '/category',
    component: () => import('@/views/category.vue'),
    meta: {
      title: '分类',
      isShowNavBar: false,
      isShowTabBar: true,
      isShowBackIcon: false,
    },
  },
  {
    path: '/search',
    component: () => import('@/views/search.vue'),
    meta: {
      title: '搜索',
      isShowNavBar: false,
      isShowTabBar: false,
      isShowBackIcon: false,
    },
  },
  {
    path: '/history',
    component: () => import('@/views/history.vue'),
    meta: {
      title: '我的足迹',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
      requireAuth: true,
    },
  },
  {
    path: '/searchresult',
    component: () => import('@/views/searchresult.vue'),
    meta: {
      title: '搜索',
      isShowNavBar: false,
      isShowTabBar: false,
      isShowBackIcon: false,
    },
  },
  {
    path: '/newslist',
    component: () => import('@/views/newslist.vue'),
    meta: {
      title: '资讯',
      isShowNavBar: true,
      isShowBackIcon: true,
    },
  },
  {
    path: '/goodsdetail/:id',
    component: () => import('@/views/goodsdetail.vue'),
    name: 'goodsdetail',
    meta: {
      title: '商品详情',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
    },
  },
  {
    path: '/login',
    component: () => import('@/views/login.vue'),
    meta: {
      title: '登录',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
    },
  },
  {
    path: '/register',
    component: () => import('@/views/register.vue'),
    meta: {
      title: '注册',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
    },
  },
  {
    path: '/setting',
    component: () => import('@/views/setting.vue'),
    meta: {
      title: '设置',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
      requireAuth: true,
    },
  },
  {
    path: '/addresslist',
    component: () => import('@/views/addresslist.vue'),
    name: 'addressList',
    meta: {
      title: '收货地址',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
      requireAuth: true,
    },
  },
  {
    path: '/addressadd',
    component: () => import('@/views/addressadd.vue'),
    meta: {
      title: '添加地址',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
      requireAuth: true,
    },
  },
  {
    path: '/editaddress/:id',
    component: () => import('@/views/addressedit.vue'),
    meta: {
      title: '编辑地址',
      isShowNavBar: true,
      isShowBackIcon: true,
      isShowTabBar: false,
      requireAuth: true,
    },
  },

  {
    path: '/test',
    component: () => import('@/views/test.vue'),
    meta: {
      title: '测试页面',
      isShowNavBar: false,
      isShowTabBar: false,
      isShowBackIcon: false,
    },
  },
]

export default routes
